﻿using Kw.Combinatorics;
using System;

namespace Kw.CombinatoricsExamples
{
    class CombinationExample01
    {
        static void Main ()
        {
            Combination cn53 = new Combination (5, 3);

            foreach (Combination row in cn53.GetRows ())
                Console.WriteLine (row);

            foreach (Combination row in new Combination (9, 8, 4).GetRows ())
                Console.WriteLine (row);
        }

        /* Output:

        { 0, 1, 2 }
        { 0, 1, 3 }
        { 0, 1, 4 }
        { 0, 2, 3 }
        { 0, 2, 4 }
        { 0, 3, 4 }
        { 1, 2, 3 }
        { 1, 2, 4 }
        { 1, 3, 4 }
        { 2, 3, 4 }
        { 0, 1, 2, 3, 5, 6, 7, 8 }
        { 0, 1, 2, 4, 5, 6, 7, 8 }
        { 0, 1, 3, 4, 5, 6, 7, 8 }
        { 0, 2, 3, 4, 5, 6, 7, 8 }
        { 1, 2, 3, 4, 5, 6, 7, 8 }
        { 0, 1, 2, 3, 4, 5, 6, 7 }
        { 0, 1, 2, 3, 4, 5, 6, 8 }
        { 0, 1, 2, 3, 4, 5, 7, 8 }
        { 0, 1, 2, 3, 4, 6, 7, 8 }

        */
    }
}
